package com.zcr.service.Impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.zcr.mapper.PermissionMapper;
import com.zcr.pojo.Permission;
import com.zcr.service.PermissionService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * @version 1.0
 * @author： 张诚
 * @date： 2021-03-06 10:22
 */
@Service("PermissionService")
public class PermissionServiceImpl extends ServiceImpl<PermissionMapper, Permission> implements PermissionService {

    @Resource
    private PermissionMapper permissionMapper;

    @Override
    public List<Permission> getByPer(String [] per) {
        QueryWrapper<Permission> wrapper= Wrappers.query();
        wrapper.in("id",per);
        return permissionMapper.selectList(wrapper);
    }

    @Override
    public List<String> getbypid(int roleid) {
        return permissionMapper.getbypid(roleid);
    }

    @Override
    public List<Permission> getbynameaa(String roleid) {
        return permissionMapper.getbynameaa(roleid);
    }
}
